#ifndef B2D_HASHMAP_H
#define B2D_HASHMAP_H

#include "Prerequisites.h"
#include <unordered_map>

NS_B2D_BEGIN

#define hashmap std::unordered_map
#define multihashmap std::unordered_multimap

////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief	Utility class to populate hashmaps on construction.
///
/// \tparam	T	Key type.
/// \tparam	U	Value type.
////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename T, typename U>
class B2D_API create_hashmap
{
private:
    hashmap<T, U> mMap;

public:
    create_hashmap(const T& key, const U& val)
    {
        mMap[key] = val;
    }

    create_hashmap<T, U>& operator()(const T& key, const U& val)
    {
        mMap[key] = val;
        return *this;
    }

    operator hashmap<T, U>()
    {
        return mMap;
    }
};

NS_B2D_END

#endif